package com.gw.vip.center.controller;

import com.gw.vip.center.dto.SetMailSenderInfoDto;
import com.gw.vip.center.service.MailService;
import com.gw.vip.common.log.PrintlnLog;
import com.gw.vip.common.vo.Result;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author GW
 * @description 邮件相关
 * @since 2022-09-26
 */
@RestController
@RequestMapping("mail")
@Slf4j
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class MailController {

    private final MailService mailService;

    @PrintlnLog(description = "设置邮件发送者信息")
    @RequestMapping("setMailSenderInfo")
    public Result setMailSenderInfo(@RequestBody @Valid SetMailSenderInfoDto dto){
        mailService.setMailSenderInfo(dto);
        return Result.success();
    }
}
